<%@ page import="dao.impl.FeedBackDaoImpl" %>
<%@ page import="entity.Feedback" %>
<%@ page import="java.util.List" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">

    <title>读取上报信息</title>
</head>
		<style>
		    td {
		        width: 100px;
		    }
		</style>
<script src="js/jquery-3.4.1.min.js"></script>
<script>
    function goChange( idd,num) {
        var a= $("#"+idd+"");
        $.get("readedServlet", {num: num}, function (data) {
            // alert("!");
            document.getElementById(idd).innerText="已读";
            // alert("!");
            a.css("color","red");
        });
    }
</script>

<body>

<table border="1" style="background-image: linear-gradient(-20deg, #e9defa 0%, #fbfcdb 100%);border:1px solid #E51094;text-align: center">
    <tr style="background-image: linear-gradient(-20deg, #e9defa 0%, #fbfcdb 100%); text-align:center">
        <td style="width:100px">上报者id</td>
        <td style="width:100px">上报者姓名</td>
        <td style="width:400px">上报信息</td>
        <td style="width:100px">查上报时间</td>
        <td style="width:80px">查询次数</td>
        <td style="width:80px">查询状态</td>
        <td style="width:100px">标记已读</td>
    </tr>
    <%
        FeedBackDaoImpl feedBackDao = new FeedBackDaoImpl();
        List<Feedback> list = feedBackDao.getByFlag();

        for (int i = 0; i < list.size(); i++) {
    %>
    <tr align="center">
        <td><%=list.get(i).getDoctorId()%>
        </td>
        <td><%=list.get(i).getDoctorName()%>
        </td>
        <td><%=list.get(i).getfMassage()%>
        </td>
        <td><%=list.get(i).getfDate()%>
        </td>
        <td><%=list.get(i).getFrequency()%>
        </td>
         <td><span id="sp<%=i%>">未读</span></td>
        <td><a name="" href="javascript:void(0)" onclick="goChange('sp<%=i%>',<%=list.get(i).getNum()%>)">标记已读</a></td>
            <%}%>

</table>
</body>
</html>
